import VueRouter from 'vue-router';

// router.beforeEach((to, from, next) => {
//     // 判断是否有token
//     var token = localStorage.getItem("token")
//     if (to.name === "login") {
//         //这里判断是不是login页面
//         next()
//     } else {
//         //在判断一次有token就直接放行
//         //如果没有就返回login页面
//         if (token) {
//             next()
//         } else {
//             next("/")
//         }
//     }
// })

const routes=[
    {
        path: '/jieshao',
        name: 'jieshao',
        component: () => import('../components/jieshao'),
        meta: {
            showNav: false,
            requireAuth: true
        },
    },
    {
        path: '/',
        name: 'login',
        component: () => import('../components/Login.vue'),
        meta: {
            showNav: false,
            requireAuth: true
        },
    },
    {
        path: '/index',
        name: 'index',
        component:()=>import('../components/index_2'),
        meta: {
            showNav: false,
            requireAuth: true
        },
        children:[
            {
                path: '/paihangbang',
                // component: PaiHangBang,
                component: () => import('../components/index_2_zujian/paihangbang'),
                name: 'paihangbang',
                children: [
                    { path: 'qiandao', component: () => import('../components/index_2_zujian/paihangbang/qiandao'), },
                    { path: 'shichang', component: () => import('../components/index_2_zujian/paihangbang/shichang'), },
                    { path: 'tianshu', component: () => import('../components/index_2_zujian/paihangbang/tianshu'), },
                    { path: 'huoyue', component: () => import('../components/index_2_zujian/paihangbang/huoyue'), },
                ],
            },
            {
                path: '/MyPlan',
                name: 'MyPlan',
                component: () => import('../components/index_2_zujian/MyPlan'),
                meta: {
                    showNav: false,
                    requireAuth: true
                },
            },
            {
                path: '/jihua',
                name: 'jihua',
                component: () => import('../components/index_2_zujian/jihua'),
                meta: {
                    showNav: false,
                    requireAuth: true
                },
            },
            {
                path: '/guihuajindu',
                name: 'guihuajindu',
                component: () => import('../components/index_2_zujian/guihuajindu'),
                meta: {
                    showNav: false,
                    requireAuth: true
                },
            },
            {
                path: '/zhiyetuijian',
                name: 'zhiyetuijian',
                component: () => import('../components/index_2_zujian/zhiyetuijian'),
                meta: {
                    showNav: false,
                    requireAuth: true
                },
                children: [
                    {
                        path: '/Bd',
                        name: 'Bd',
                        component: () => import('../components/index_2_zujian/zhiye_zujian/Bd-D'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                    {
                        path: '/Building',
                        name: 'Building',
                        component: () => import('../components/index_2_zujian/zhiye_zujian/BuildingCareer'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                    {
                        path: '/Entrepreneurs',
                        name: 'Entrepreneurs',
                        component: () => import('../components/index_2_zujian/zhiye_zujian/EntrepreneursCareer'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                    {
                        path: '/Finance',
                        name: 'Finance',
                        component: () => import('../components/index_2_zujian/zhiye_zujian/FinanceCareer'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                    {
                        path: '/Internet',
                        name: 'Internet',
                        component: () => import('../components/index_2_zujian/zhiye_zujian/InternetCareer'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                    {
                        path: '/Whole',
                        name: 'Whole',
                        component: () => import('../components/index_2_zujian/zhiye_zujian/WholeCareer'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                ]
            },
            // {
            //     path: '/',
            //     name: 'home',
            //     component: WebPage
            // },
            {
                path: '/jianli',
                name: 'jianli',
                component: () => import('../components/index_2_zujian/jianli'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/daka',
                name: 'daka',
                component: () => import('../components/index_2_zujian/daka'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/zhuanjia',
                name: 'zhuanjia',
                component:()=>import('../components/index_2_zujian/zhuanjia'),
                meta: {
                    showNav: false,
                    requireAuth: true
                },
                redirect:'/careerPage',

                children:[
                    {
                        path: '/careerPage',
                        name: 'careerPage',
                        component: () => import('../components/index_2_zujian/careerPage_1')
                    },
                    {
                        path: '/career_2',
                        name: 'career_2',
                        component: () => import('../components/index_2_zujian/career_2')
                    },
                    {
                        path: '/career_3',
                        name: 'career_3',
                        component: () => import('../components/index_2_zujian/career_3')
                    },
                    {
                        path: '/detail',
                        name: 'detail',
                        component:()=>import('../components/index_2_zujian/detail.vue'),
                        meta: {
                            showNav: false,
                            requireAuth: true
                        }
                    },
                ]
            },

            {
                path: '/test',
                name: 'test',
                component:()=>import('../components/index_2_zujian/test'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/Chat',
                name: 'Chat',
                component:()=>import('../components/index_2_zujian/chat_'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/home',
                name: 'home',
                component:()=>import('../components/index_2_zujian/home'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/job',
                name: 'job',
                component:()=>import('../components/index_2_zujian/job'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/up',
                name: 'up',
                component:()=>import('../components/Index_zujian/up'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/date_vue',
                name: 'date_vue',
                component:()=>import('../components/index_2_zujian/date_vue'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            },
            {
                path: '/jindu',
                name: 'jindu',
                component:()=>import('../components/index_2_zujian/jindu'),
                meta: {
                    showNav: false,
                    requireAuth: true
                }
            }
        ]
    },
    {
        path: '/GeRen',
        name: 'GeRen',
        component:()=>import('../components/index_2_zujian/GeRen'),
        meta: {
            showNav: false,
            requireAuth: true
        }
    }
    // {
    //     path: '/Main2',
    //     name: 'Main2',
    //     component:()=>import('../../chatgpt-web-application-master/client/Main2')
    // },
    // {
    //     path: '/Gpt',
    //     name: 'Gpt',
    //     component:()=>import('../components/Gpt')
    // }
]
const router= new VueRouter({
    mode:'history',
    routes
})
export default  router;
